// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__930FB69E_0BC9_4762_8B64_6EFDA2346DD3__INCLUDED_)
#define AFX_MAINFRM_H__930FB69E_0BC9_4762_8B64_6EFDA2346DD3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxinet.h>
#include "ProgBar.h"

UINT connect(LPVOID lpParam);
void StartServList(CString curDir);
UINT ServList(LPVOID lpParam);
UINT ServListEx(LPVOID lpParam);
UINT UploadFileThread(LPVOID lpParam);
UINT DownloadFileThread(LPVOID lpParam);
void logRespInfo(COLORREF m_TextColor = RGB(0,0,0));

class CMainFrame : public CFrameWnd
{
	
protected: // create from serialization only
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)

// Attributes
public:
	CProgStatusBar  m_wndStatusBar;
	CString strConfigFile;
	CString strWorkingDir;
	CString szLastDir;
	CString strAppName;

// Operations
public:
	BOOL ReadConfig();
	void notifyDel();
	void notifyAdd();
	void WriteConfig();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CToolBar    m_wndToolBar;
	CToolBar    m_QueueToolBar;
	CDialogBar   m_wndQuickConnect;
	CSplitterWnd m_wndSplitter1;

	CString m_host;
	CString m_username;
	CString m_password;
	int m_port;
	CString szFtpInfo;

	HANDLE hThread;
	DWORD ThreadID;

// Generated message map functions
protected:
	CImageList m_ToolbarImagesDisabled1;
	CImageList m_ToolbarImagesHot1;
	CImageList m_ToolbarImages1;
	CImageList m_ToolbarImagesDisabled2;
	CImageList m_ToolbarImagesHot2;
	CImageList m_ToolbarImages2;
	void AttachToolbarImages (int m_ToolBarSeq,UINT inNormalImageID,UINT inDisabledImageID,UINT inHotImageID);
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnConn();
	afx_msg void OnGo();
	afx_msg void OnDisconnect();
	afx_msg void OnRefresh();
	afx_msg void OnAddDownload();
	afx_msg void OnAddUpload();
	afx_msg void OnSiteman();
	afx_msg void OnClose();
	afx_msg void OnUpdateConnected(CCmdUI* pCmdUI);
	afx_msg void OnUpdateGo(CCmdUI* pCmdUI);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnOption();
	afx_msg void OnStop();
	afx_msg void OnReconnect();
	afx_msg void OnUpdateQueue(CCmdUI* pCmdUI);
	afx_msg void OnUpdateQueueUp(CCmdUI* pCmdUI);
	afx_msg void OnUpdateQueueDown(CCmdUI* pCmdUI);
	//}}AFX_MSG
	afx_msg LRESULT OnGo(WPARAM wParam,LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__930FB69E_0BC9_4762_8B64_6EFDA2346DD3__INCLUDED_)
